package com.ssy.lingxi.order.model.vo.platform.response;

import com.ssy.lingxi.order.model.constant.OrderOperationEnum;
import com.ssy.lingxi.order.model.constant.OrderOuterStatusEnum;
import com.ssy.lingxi.order.utils.NumberUtil;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * 平台后台 - 日志中心 - 查询订单外部历史记录返回
 * @author 万宁
 * @version 2.0.0
 * @date 2021-12-04
 */
public class PlatformOrderOuterHistoryVO implements Serializable {
    private static final long serialVersionUID = 450924846271051471L;

    public PlatformOrderOuterHistoryVO(String orderNo, LocalDateTime createTime, String roleName, Integer outerStatus, String statusName, Integer operateCode, String operation, String remark) {
        this.orderNo = orderNo;
        this.createTime = createTime == null ? "" : createTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"));
        this.roleName = roleName;
        this.statusName = NumberUtil.isNullOrZero(outerStatus) ? statusName : OrderOuterStatusEnum.getNameByCode(outerStatus);
        this.operation = NumberUtil.isNullOrZero(operateCode) ? operation : OrderOperationEnum.getNameByCode(operateCode);
        this.remark = remark;
    }

    /**
     * 订单号
     */
    private String orderNo;

    /**
     * 操作时间，格式为yyyy-MM-dd HH:mm
     */
    private String createTime;

    /**
     * 操作角色
     */
    private String roleName;

    /**
     * 状态名称
     */
    private String statusName;

    /**
     * 操作
     */
    private String operation;

    /**
     * 备注说明
     */
    private String remark;

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public String getStatusName() {
        return statusName;
    }

    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }

    public String getOperation() {
        return operation;
    }

    public void setOperation(String operation) {
        this.operation = operation;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
